package org.example.springboot.service;

import org.example.springboot.dao.InBoundMapper;
import org.example.springboot.dao.ProductsMapper;
import org.example.springboot.model.InBound;
import org.example.springboot.model.Products;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
@Service
public class InBoundService {
    @Autowired
    private InBoundMapper inBoundMapper;

    public String insertInBound(String productName,String modelNumber, String supplierName,String quantity,String totalAmount, String inTime,String inOrderId){
        inBoundMapper.insertInBound(productName,modelNumber,supplierName,quantity,totalAmount,inTime,inOrderId);
        return "succeed";
    }

    public List<InBound> getAllInBound(){
        return inBoundMapper.getAllInBound();
    }

    public List<InBound> findInBoundByKeyword(String keyword){
        return inBoundMapper.findInBoundByKeyword(keyword);
    }

    public InBound getInBoundById(int id){
        return inBoundMapper.getInBoundById(id);
    }

    public void deleteInBoundById(int id){
        inBoundMapper.deleteInBoundById(id);
    }
}
